myApp.controller('loginController',function($scope,$state,toaster,$serAccessSignin){
    var ctrl = this;
    ctrl.user = {};
    ctrl.login = function(phone,password) {
        $serAccessSignin.setUser({
            phone:phone||'',
            password:password||''
        }).then(function (res) {
            if(res.code == 1){
                $state.go('app.home');
            }else {
                toaster.info('提示',res.message);
            }
        });
    };
});